package com.software.seakdream.service;

import com.software.seakdream.entity.AudioInfo;
import com.software.seakdream.entity.Favorite;
import com.software.seakdream.entity.FreeConbination;
import com.software.seakdream.repository.AudioInfoRepository;
import com.software.seakdream.repository.UserInfoRepository;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
@Service
public class AudioInfoServiceImpl implements AudioInfoService{
    @Autowired
    private AudioInfoRepository audioInfoRepository;
    @Override
    public List<AudioInfo> findAudioInfo(String type,String category) {
        List<AudioInfo> audioInfos = audioInfoRepository.findAudioInfo(type,category);
        System.out.println(audioInfos);

        return audioInfos;
    }

    @Override
    public List<AudioInfo> queryFavorite(String userId) {
        List<AudioInfo> audioInfos = audioInfoRepository.queryFavorite(userId);
        return audioInfos;
    }

    @Override
    public List<Favorite> queryFavoriteW(String userId) {
        List<Favorite> audioInfos = audioInfoRepository.queryFavoriteW(userId);
        return audioInfos;
    }

    @Override
    public AudioInfo findAudioInfoById(String audioId) {
        return audioInfoRepository.findAudioInfoById(audioId);
    }

    @Override
    public List<AudioInfo> findAllAudioInfo(String type) {
        List<AudioInfo> audioInfos = audioInfoRepository.findAllAudioInfo(type);
        return audioInfos;
    }
}
